package com.goldman.aplt.controller;

import com.goldman.aplt.base.type.ComAp;
import com.goldman.aplt.service.droplist.AppDropListService;
import com.goldman.aplt.service.parameter.AppSystemParameterService;
import com.goldman.http.common.s2s.model.ResponseData;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@Slf4j
@RestController
@RequestMapping("/ap")
public class ApController {

    @Autowired
    private AppDropListService appDropListService;
    @Autowired
    private AppSystemParameterService appSystemParameterService;

    @PostMapping("/queryDropList")
    public ResponseData<List> queryDropList(@RequestBody ComAp.DropListIn in) {
        return ResponseData.success(appDropListService.getListByType(in.getDropType()));
    }

    @PostMapping("/qryDropListBySuper")
    public ResponseData<List> qryDropListBySuper(@RequestBody ComAp.DropListIn in) {
        return ResponseData.success(appDropListService.getListBySuper(in.getSuperType(), in.getSuperValue()));
    }

    @PostMapping("/qryParm")
    public ResponseData<List<ComAp.QryParmOut>> qryParm(@RequestBody List<ComAp.QryParmIn> in) {
        return ResponseData.success(appSystemParameterService.getParms(in));
    }
}
